using Microsoft.AspNetCore.SignalR;
using SqlSugar;
using System.Threading.Tasks;

namespace EnergyManagement.Api.Hubs
{
    public class EnergyHub : Hub
    {
        private readonly ISqlSugarClient _db;
        
        public EnergyHub(ISqlSugarClient db)
        {
            _db = db;
        }

        public async Task SendRealtimeData(EnergyData data)
        {
            await Clients.All.SendAsync("ReceiveRealtimeData", data);
        }
    }
}
